<?php
namespace app\admin\model;

/**
* 新闻
*/
class NewsModel extends \think\Model
{
	protected $table = 'news';

    /**
     * 连(分类)表 查询所有新闻
     */
    public function getAllByLeftjoin($start, $size)
    {
        return $this
        ->field('n.*,c.name as cname')
        ->alias('n')
        ->join('news_categorys c','n.nid = c.id','LEFT')
        ->limit($start, $size)
        ->select();
    }
}
